/**
 * @param {string} s
 * @return {boolean}
 */
var isPalindrome = function(s) {
    if (s == '') return true
    s = s.replace(/[^a-zA-Z0-9]/gi, '').toLowerCase()
    var i = 0,
        j = s.length - 1;
    while (i < j) {
        if (s.charAt(i) != s.charAt(j)) return false
        i++;
        j--;
    }
    return true;
};
console.log(isPalindrome(' leetco, de;'));